function changeAPcode() {
	var m = "books.com.tw/";
	var apcode = "huee11";
	for (var i=0;i<document.links.length;i++) {
		var strLink = new String(document.links[i]);
		var pos = new Number(strLink.indexOf(m));
		if (pos != -1) {
			domain = strLink.substr(0, pos+m.length);
			path = strLink.substr(pos+m.length);
			apLink = domain + "exep/assp.php/" + apcode + "/" + path;
			document.links[i].href = apLink;
			document.links[i].target = "_blank";
		}
	}
}

function changeOtherAPcode() {
	for (var i=0;i<document.links.length;i++) {
		var strLink = new String(document.links[i]);
		apLink = 'http://www.books.com.tw/exep/assp.php/huee11/exep/ap.php?apid=books&areaid=igoogle&url='+strLink;
		document.links[i].href = apLink;
		document.links[i].target = "_blank";
	}
}

